#include <libc.h>
#include <io.h>

int add(int par1,int par2) {
    int ret;
    __asm__(
	"movl 8(%%ebp), %0\n"
	"addl 12(%%ebp), %0\n"
    :
    : "g" (ret)
    );
    return ret;
}



int __attribute__ ((__section__(".text.main")))
  main(void)
{
    /* Next line, tries to move value 0 to CR3 register. This register is a privileged one, and so it will raise an exception */
    // __asm__ __volatile__ ("mov %0, %%cr3"::"r" (0) );
    /* Uncomment next line to call the initial routine for the test cases */
    /* runjp(); */
    int a = 0;
    a = add(123,321);
    //char c = 'c';
    //printc(c);
    int aaaa = write(1,"PROVA_WRITE: ",13);
    if (aaaa == 13) write(1,"OK!\n",4);
    while(1);
    return 0;
}
